package com.xwli.business.strategy.base;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author xwli
 * @date: 2022/8/18 15:26
 * @desc
 * @since JDK 1.8
 */
public abstract class BaseAwardTemplate {

    private static final Logger log = LoggerFactory.getLogger(BaseAwardTemplate.class);

    //奖励发放模板方法
    public Boolean awardTemplate(String userId) {
        this.authentication(userId);
        this.risk(userId);
        return this.awardRecord(userId);
    }

    //身份验证
    protected void authentication(String userId) {
        log.info("{} 执行身份验证!", userId);
    }

    //风控
    protected void risk(String userId) {
        log.info("{} 执行风控校验!", userId);
    }

    //执行奖励发放
    protected abstract Boolean awardRecord(String userId);
}

